//
//  StatusTVC.m
//  LoveFreshBeen
//
//  Created by vinsent on 16/10/20.
//  Copyright © 2016年 魏根. All rights reserved.
//

#import "StatusTVC.h"
#import "StatusModel.h"
#import "StatusTableCell.h"

@interface StatusTVC ()

@end

@implementation StatusTVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setUpTableViewUI];
    
}

- (void)setUpTableViewUI {
    self.tableView.rowHeight = 80;
    self.tableView.separatorInset = UIEdgeInsetsMake(0, 100, 0, 0);
    self.tableView.tableFooterView = [UIView new];
    [self.tableView setAllowsSelection:NO];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    return self.statusVModel.statuses.count;
}
                                                     
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    StatusModel *status = self.statusVModel.statuses[indexPath.row];
    
    StatusTableCell *cell = [[NSBundle mainBundle] loadNibNamed:@"StatusTableCell" owner:nil options:nil].lastObject;
    
    cell.statusM = status;
    
//    cell.isDrawLine = (indexPath.row != 0 && ;
    cell.isFirstCell = indexPath.row == 0;
    cell.isLastCell = indexPath.row == self.statusVModel.statuses.count - 1;
    
    return cell;
}

- (StatusViewModel *)statusVModel {
    if (_statusVModel == nil) {
        _statusVModel = [[StatusViewModel alloc] init];
    }
    return _statusVModel;
}

@end
